<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页管理</title>
    <link rel="stylesheet" href="/public/css/fonts/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/public/css/fonts/linecons/css/linecons.css">
    <link rel="stylesheet" href="/public/css/bootstrap.css">
    <link rel="stylesheet" href="/public/css/xenon-core.css">
    <link rel="stylesheet" href="/public/css/xenon-forms.css">
    <link rel="stylesheet" href="/public/css/xenon-components.css">
    <link rel="stylesheet" href="/public/css/xenon-skins.css">
    <link rel="stylesheet" href="/public/css/custom.css">

    <link rel="stylesheet" type="text/css" href="/public/css/style.css">


    <script src="/public/js/jquery-1.11.1.min.js"></script>

    *{<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>}*
    *{<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>}*

    <script src="/public/lib/layer/js/layer.js"></script>
    <script type="text/javascript">
        var showPosition = '${showPosition}';

        $(function () {
            // 提示
            var msg = '${flash.get("msg")}';
            var success = '${flash.get("success")}';
            var iconId = 0 ;
            if(success) iconId = 6 ;
            if (msg) {
                layer.alert(msg,{icon: iconId , title:'系统提示'});
            }
//            alert(merchantId)
            $(document).on('click','.showpostion',function () {
                var postion = $(this).attr('showpostion');
                var url = '/activity/ActivityCtrl/index?showPosition='+postion;
                if(postion == 'INDEX_PRODUCT_RECOMMEND'){
                    var activityId = $(this).attr('activityId');
                    url += '&activityId='+ activityId;
                }
                window.location.href = url;

            })
        })
    </script>



</head>
<body class="page-body">
<div class="page-container">
    <div class="sidebar-menu toggle-others fixed" style="width: 460px;">
        <div class="sidebar-menu-inner ps-container ps-active-y">
            <div class="phone_bg">
                <div class="phone_title">
                </div>
                <div class="phone_page content scroll_y">
                    <div showpostion="INDEX_BLOCK"  class="showpostion banner" >
                    #{if blockActivity != null && blockActivity.activityProducts.size()> 0}
                        <img src="${blockActivity?.activityProducts[0]?.imgSrc}" alt="">
                    #{/if}
                    #{else }
                        <img src="/public/activityImages/pic_add1.jpg" alt="">
                    #{/else}
                    </div>
                    <div showpostion="INDEX_NOTICE"  class="showpostion notice m6">
                        <div class="notice_t pull-left"><strong>日职头条</strong><span>|</span> </div>
                        <div class="scroll-uptext" >
                            <div class="swiper-wrapper">
                            #{if noticeActivity != null}
                                #{list noticeActivity.activityProducts , as:'notice'}
                                    <div class="swiper-slide"><a href="#">${notice?.title}</a></div>
                                #{/list}
                            #{/if}
                            #{else}
                                <div class="swiper-slide"><a href="#">还没添加~~~</a></div>
                            #{/else}
                            </div>
                        </div>
                    </div>
                    <div showpostion="INDEX_SECKILL" class="showpostion s_kill m6">
                        <div class="kill_t"><strong class="pull-left">限时秒杀</strong><span class="pull-left">${seckillActivity?.beginAt?.format('yyyy-MM-dd')}~${seckillActivity?.endAt?.format('yyyy-MM-dd')} 每日   ${seckillActivity?.beginTimes}-${seckillActivity?.endTimes}</span></div>
                        <div class="kill_c">
                        #{if seckillActivity != null && seckillActivity.activityProducts.size() > 0}
                            #{list seckillActivity.activityProducts ,as : 'seckill'}
                            #{if seckill_index < 7}

                                <a href="#" style="margin-bottom: 1rem">
                                    <img  height="100px"  src="${seckill?.product?.mainImage != null ? seckill?.product?.mainImage : '/public/activityImages/nopic.gif'}">
                                    <h3>${seckill?.product?.name}</h3>
                                    <p><i>￥${seckill?.activityPrice}</i>/${seckill?.product?.spec}</p>
                                </a>
                            #{/if}
                            #{/list}
                            #{if seckillActivity.activityProducts.size() < 6}
                            <a href="#"><img src="/public/activityImages/btn_add.png"><h3>商品名称</h3><p><i>￥价格</i>/规格</p></a>
                            #{/if}
                        #{/if}
                        #{else }
                            <a href="#"><img src="/public/activityImages/btn_add.png"><h3>商品名称</h3><p><i>￥价格</i>/规格</p></a>
                        #{/else}
                        </div>
                    </div>
                    <div showpostion="INDEX_PROMOTION"  class=" showpostion s_pic">
                    #{if promotionActivity != null}
                        <a href="#"><img proId="${promotionActivity?.id}" src="${promotionActivity?.mainImg}"/></a>
                    #{/if}
                    #{else }
                        <a href="#"><img src="/public/activityImages/pic_add2.jpg"/></a>
                    #{/else}		            </div>
                #{list recommendActivityList , as : 'recommend'}
                    <div showpostion="INDEX_PRODUCT_RECOMMEND" activityId="${recommend?.id}"  class="showpostion card0 mainbox1 m6">
                        <div class="card-header">
                            <a href="#">
                                <h3 class="pull-left"><font color="${recommend.titleColour}">${recommend?.title}</font>   #{if recommend?.subtitle}| <span><font color="${recommend.subtitleColour}">${recommend?.subtitle}</font></span>   #{/if}</h3>
                                <img src="${recommend?.mainImg}"/>
                            </a>
                        </div>
                        <div class="card-content">
                            <ul class="card_list">
                                #{if recommend != null}
                                    #{list recommend.activityProducts , as :'product'}

                                        <li><a href="#"> <img src="${product?.product?.mainImage != null ? product?.product?.mainImage : '/public/activityImages/nopic.gif'}"></a>
                                            <h3>${product?.product?.name}</h3><span>${product?.product?.spec}/${product?.product?.unit}</span>
                                            <p>
                                                <em>￥${product?.product?.merchantPrice}</em>
                                            </p>
                                        </li>
                                    #{/list}
                                    #{if recommend.activityProducts.size() < 6}
                                        <li><a href="#"><img src="/public/activityImages/btn_add.png"></a><h3>添加产品</h3><span>500g/捆</span><p><em>￥2.5</em><i>￥3.2</i></p></li>

                                    #{/if}
                                #{/if}
                                #{else }
                                    <li><a href="#"><img src="/public/activityImages/btn_add.png"></a><h3>添加产品</h3><span>500g/捆</span><p><em>￥2.5</em><i>￥3.2</i></p></li>
                                #{/else}

                            </ul>
                        </div>
                    </div>
                #{/list}
                    <div showpostion="INDEX_PRODUCT_RECOMMEND" class=" showpostion cardAdd_btn">
                        <a href="#"><img src="/public/activityImages/btn_add.png"/></a>
                        <h3>添加产品版块</h3>
                    </div>

                    #{if recommendMerchants != null && recommendMerchants.activityProducts.size() > 0}
                    <div class="card0 mainbox2 m6">
                        <div class="card-header">
                            <a href="#">
                                <h3 class="pull-left">推荐商家</h3>
                            </a>
                        </div>

                        <div showpostion="MERCHANT_RECOMMEND" activityId="${recommendMerchants?.id}"  class="showpostion card-content">
                            <ul class="card_list">
                                #{list recommendMerchants.activityProducts ,as :'recommendMerchant'}
                                    #{if recommendMerchant?.merchant?.verifyState.toString() == 'PASS'}
                                        <li><a href="#"><img src="${recommendMerchant?.merchant?.imagePath != null ?recommendMerchant?.merchant?.imagePath : '/public/activityImages/nopic.gif'}"></a>
                                            <h3>${recommendMerchant?.merchant?.name}</h3>
                                        </li>
                                    #{/if}
                                #{/list}

                            </ul>
                        </div>
                    </div>
                    #{/if}
                    #{else}
                        <div showpostion="MERCHANT_RECOMMEND" class=" showpostion cardAdd_btn">
                            <a href="#"><img src="/public/activityImages/btn_add.png"/></a>
                            <h3>添加推荐商家</h3>
                        </div>
                    #{/else}

                </div>
            </div>
            <div class="phone-bt">
                <img src="/public/activityImages/iphone6_b.jpg">
            </div>
        </div>
    </div>


    <div class="main-content">
        <div class="page-title">
            <div class="title-env">
                <h1 class="title" style="line-height: 2em;">编辑模板</h1>
                <!--<p class="description">产品全部分类</p>-->
            </div>
            <div class="breadcrumb-env">
                <ol class="breadcrumb bc-1">
                    <li>
                        <a href="/">返回</a>
                    </li>
                    <li class="active">
                        <strong>编辑模板</strong>
                    </li>
                </ol>

            </div>

        </div>
       #{include 'activity/ActivityCtrl/editPage.html'/}

    </div>

</div>

<div class="modal fade" id="id_kill_product">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">秒杀产品</h4>
            </div>
            <div class="modal-body">
                <form id="editKillProductForm" role="form" action="/activity/ActivityCtrl/saveSeckllProduct" class="form-horizontal">
                    <input id="id_activity_id" name="activityProduct.activity.id" type="hidden" >
                    <input id="id_activity_product_id" name="activityProduct.id" type="hidden" >
                    <input id="id_product_id" name="activityProduct.product.id" type="hidden" >
                    <div class="form-group">
                        <label class="col-sm-3 control-label" for="menu_item_name">产品名称:</label>
                        <div class="col-sm-9">
                            <input id="id_product_name" name="activityProduct.product.name" type="text" class="form-control select-product" readonly  placeholder="请选择产品">
                        </div>
                    </div>
                    <div class="form-group-separator"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label" for="parent_menu_item_name">秒杀价格:</label>
                        <div class="col-sm-9">
                            <input id="id_product_activityPrice" name="activityProduct.activityPrice" class="form-control" type="number" value="0" placeholder="秒杀价格">
                        </div>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-info" onclick="saveKillProduct()">保存</button>
            </div>
        </div>
    </div>
</div>

<link rel="stylesheet" href="/public/js/dropzone/css/dropzone.css">

<script src="/public/js/bootstrap.min.js"></script>
<script src="/public/js/TweenMax.min.js"></script>
<script src="/public/js/resizeable.js"></script>
*{<script src="/public/js/joinable.js"></script>}*
<script src="/public/js/xenon-api.js"></script>
<script src="/public/js/xenon-toggles.js"></script>
<script src="/public/js/dropzone/dropzone.min.js"></script>
<script src="/public/js/xenon-custom.js"></script>

<script src="/public/js/daterangepicker/daterangepicker.js"></script>
<script src="/public/js/datepicker/bootstrap-datepicker.js"></script>
<script src="/public/js/timepicker/bootstrap-timepicker.min.js"></script>


</body>
</html>